const Base = require("../base.js");
/*地图操作*/
const key = "1ca50beb27f893268297a00cdb0acdf3"
const city = "全国"
module.exports = class extends Base {
  async geoAction(){
    const address = this.get("address")
    const {geocodes} = await this.dxGet("https://restapi.amap.com/v3/geocode/geo",{
      key,
      address,
      city
    })
    const arrList = []
    try{
      geocodes.map(a=>{
        arrList.push({
          label:a.formatted_address,
          value:a.location,
          city:a.city
        })
      })
    }catch(e){

    }
    this.success(arrList)
  }
};
